var __extends =
    (this && this.__extends) ||
    (function () {
      var n = function (t, e) {
        return (n =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (n, t) {
              n.__proto__ = t;
            }) ||
          function (n, t) {
            for (var e in t)
              Object.prototype.hasOwnProperty.call(t, e) && (n[e] = t[e]);
          })(t, e);
      };
      return function (t, e) {
        function i() {
          this.constructor = t;
        }
        if ("function" != typeof e && null !== e)
          throw new TypeError(
            "Class extends value " + String(e) + " is not a constructor or null"
          );
        n(t, e),
          (t.prototype =
            null === e
              ? Object.create(e)
              : ((i.prototype = e.prototype), new i()));
      };
    })(),
  AXDinnerPersonView = (function (n) {
    function t() {
      var t = n.call(this) || this;
      return (
        (t.max = 99),
        (t.min = 1),
        (t.step = 1),
        (t.num = 1),
        (t.onLoadDinnerDataFn = {
          caller: t,
          code: 1104,
          method: function (n) {
            0 == n.code
              ? (ToastView.toastView(n.data), t.close())
              : ToastView.toastView(n.msg);
          },
        }),
        t.btn_dinnerSure.on(Laya.Event.CLICK, t, t.onClickDinnerPSuboardFn),
        t.btn_dinnerCancle.on(Laya.Event.CLICK, t, t.close),
        t.slide_dinner.on(Laya.Event.CHANGE, t, t.onSliderCommonInputChange),
        t.btn_dinner_dec.on(Laya.Event.CLICK, t, t.onDidClickItemFn),
        t.btn_dinner_plus.on(Laya.Event.CLICK, t, t.onDidClickItemFn),
        WebSocketService.addListener(t.onLoadDinnerDataFn),
        t
      );
    }
    return (
      __extends(t, n),
      (t.showPropertyView = function (n) {
        null == this.dinnerView &&
          ((this.dinnerView = new t()), (this.dinnerView.zOrder = 1e3)),
          this.dinnerView.popup(!0),
          (this.dinnerView.jsonObj = n),
          this.dinnerView.initUI();
      }),
      (t.prototype.initUI = function () {
        this.jsonObj.mqd;
        var n = ((0.15 * parseInt(this.jsonObj.mqd)) / 2e5) * 100;
        this.lbl_mingzhonglv.text = n.toFixed(2) + "%";
        var t = ((0.1 * parseInt(this.jsonObj.mqd)) / 2e5) * 100;
        this.lbl_baojilv.text = t.toFixed(2) + "%";
        var e = ((0.1 * parseInt(this.jsonObj.mqd)) / 2e5) * 100;
        this.lbl_fanjilv.text = e.toFixed(2) + "%";
        var i = ((0.05 * parseInt(this.jsonObj.mqd)) / 2e5) * 100;
        this.lbl_zhiminglv.text = i.toFixed(2) + "%";
        var s = ((0.15 * parseInt(this.jsonObj.mqd)) / 2e5) * 100;
        this.lbl_fabaolv.text = s.toFixed(2) + "%";
        var o = ((0.1 * parseInt(this.jsonObj.mqd)) / 2e5) * 100;
        (this.lbl_duobilv.text = o.toFixed(2) + "%"),
          (this.max = 10),
          (this.min = 1),
          (this.label_dinner_num.text = "1"),
          (this.slide_dinner.max = this.max),
          (this.slide_dinner.value = 1);
      }),
      (t.prototype.onClickDinnerPSuboardFn = function () {
        void 0 != this.num && this.num < 1
          ? ToastView.toastView("请选择宴请次数")
          : WebSocketService.send({
              c: 1104,
              d: { id: this.jsonObj.id, count: this.num },
            });
      }),
      (t.prototype.onSliderCommonInputChange = function () {
        this.slide_dinner.value < 1 &&
          ((this.label_dinner_num.text = "1"), (this.slide_dinner.value = 1)),
          (this.num = this.slide_dinner.value),
          (this.label_dinner_num.text =
            "宴请" + this.slide_dinner.value + "次");
      }),
      (t.prototype.onDidClickItemFn = function (n) {
        "item0" == n.target.name
          ? ((this.num = this.num - this.step),
            this.num < this.min && (this.num = this.min),
            (this.slide_dinner.value = this.num))
          : "item1" == n.target.name &&
            ((this.num = this.num + this.step),
            this.num > this.max && (this.num = this.max),
            (this.slide_dinner.value = this.num)),
          (this.label_dinner_num.text =
            "宴请" + this.slide_dinner.value + "次");
      }),
      (t.close = function () {
        this.dinnerView && this.dinnerView.close();
      }),
      t
    );
  })(ui.SuboardinateController.AXDinnerPersonViewUI);
